package game.ecosysteme;

import org.apache.log4j.Logger;

public class Statistique {

	private final static Logger log = Logger.getLogger(Statistique.class);

	private static int populationClanA = 0;
	private static int populationClanB = 0;
	private static int populationClanC = 0;
	private static int nbNaissanceClanA = 0;
	private static int nbNaissanceClanB = 0;
	private static int nbNaissanceClanC = 0;
	private static int nbHomicideA = 0;
	private static int nbHomicideB = 0;
	private static int nbHomicideC = 0;

	public static void plusUneVieA() {
		nbNaissanceClanA++;
	}

	public static void plusUneVieB() {
		nbNaissanceClanB++;
	}

	public static void plusUneVieC() {
		nbNaissanceClanC++;
	}

	public static void plusUneVie(Vie v) {
		if (v.getClan() == Vie.CLAN_A) {
			plusUneVieA();
		} else if (v.getClan() == Vie.CLAN_B) {
			plusUneVieB();
		} else {
			plusUneVieC();
		}
	}

	public static void uneVieATuer() {
		nbHomicideA++;
	}

	public static void uneVieBTuer() {
		nbHomicideB++;
	}

	public static void uneVieCTuer() {
		nbHomicideC++;
	}

	public static void uneVieTuer(Vie v) {
		if (v.getClan() == Vie.CLAN_A) {
			uneVieATuer();
		} else if (v.getClan() == Vie.CLAN_B) {
			uneVieBTuer();
		} else {
			uneVieCTuer();
		}
	}

	public static void afficher() {
		log.info("A (pop,nes,tues) : " + nbNaissanceClanA+","+nbHomicideA);
		log.info("B (pop,nes,tues) : " + nbNaissanceClanB+","+nbHomicideB);
		log.info("C (pop,nes,tues) : " + nbNaissanceClanC+","+nbHomicideC);
	}
}
